import request from '@/utils/request'

export function getList(page, limit, studentQuery) {
  return request({
    url: `/dormitory/student/list/${page}/${limit}`,
    method: 'post',
    data: studentQuery
  })
}

export function getStudent(id) {
  return request({
    url: `/dormitory/student/getStudent/${id}`,
    method: 'get'
  })
}

export function save(student) {
  return request({
    url: `/dormitory/student/save`,
    method: 'post',
    data: student
  })
}

export function update(student) {
  return request({
    url: `/dormitory/student/update`,
    method: 'post',
    data: student
  })
}

export function remove(id) {
  return request({
    url: `/dormitory/student/remove/${id}`,
    method: 'delete'
  })
}

export function departmentList() {
  return request({
    url: `/dormitory/department/departmentList`,
    method: 'get'
  })
}

export function majorList() {
  return request({
    url: `/dormitory/department/majorList`,
    method: 'get'
  })
}

export function majorListById(id) {
  return request({
    url: `/dormitory/department/majorListById/${id}`,
    method: 'get'
  })
}
